package com.taoism.customEnum;

/**
 * SQL方法枚举
 *
 * @author 李嘉
 * @version 1.0
 * @Description SQL方法枚举
 * @date 2019-07-13 19:56
 */
public enum SQLMethodEnum {

    /**
     * 新增
     */
    INSERT("新增", 1),

    /**
     * 修改
     */
    UPDATE("修改", 2);

    private String name;
    private int index;

    SQLMethodEnum() {
    }

    SQLMethodEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(int index) {
        for (SQLMethodEnum info : SQLMethodEnum.values()) {
            if (info.getIndex() == index) {
                return info.getName();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
